﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.Report"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ReportEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the ID property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxID;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ID property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDLabel;
		
		/// <summary>
		/// TextBox for the Naziv property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxNaziv;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Naziv property.
		/// </summary>
		protected System.Windows.Forms.Label uxNazivLabel;
		
		/// <summary>
		/// TextBox for the IDParent property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxIDParent;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDParent property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDParentLabel;
		
		/// <summary>
		/// TextBox for the SelectString property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxSelectString;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the SelectString property.
		/// </summary>
		protected System.Windows.Forms.Label uxSelectStringLabel;
		
		/// <summary>
		/// TextBox for the Tip property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxTip;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Tip property.
		/// </summary>
		protected System.Windows.Forms.Label uxTipLabel;
		
		/// <summary>
		/// TextBox for the Kolumne property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxKolumne;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Kolumne property.
		/// </summary>
		protected System.Windows.Forms.Label uxKolumneLabel;
		
		/// <summary>
		/// TextBox for the Filter property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxFilter;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Filter property.
		/// </summary>
		protected System.Windows.Forms.Label uxFilterLabel;
		
		/// <summary>
		/// TextBox for the FilterAdv property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxFilterAdv;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the FilterAdv property.
		/// </summary>
		protected System.Windows.Forms.Label uxFilterAdvLabel;
		
		/// <summary>
		/// TextBox for the Poredak property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxPoredak;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Poredak property.
		/// </summary>
		protected System.Windows.Forms.Label uxPoredakLabel;
		#endregion
		
		#region Main entity
		private Entities.Report _Report;
		/// <summary>
		/// Gets or sets the <see cref="Entities.Report"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.Report"/> instance.</value>
		public Entities.Report Report
		{
			get {return this._Report;}
			set
			{
				this._Report = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxID.DataBindings.Clear();
			this.uxID.DataBindings.Add("Text", this.uxBindingSource, "ID", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxNaziv.DataBindings.Clear();
			this.uxNaziv.DataBindings.Add("Text", this.uxBindingSource, "Naziv", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDParent.DataBindings.Clear();
			this.uxIDParent.DataBindings.Add("Text", this.uxBindingSource, "IDParent", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxSelectString.DataBindings.Clear();
			this.uxSelectString.DataBindings.Add("Text", this.uxBindingSource, "SelectString", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxTip.DataBindings.Clear();
			this.uxTip.DataBindings.Add("Text", this.uxBindingSource, "Tip", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxKolumne.DataBindings.Clear();
			this.uxKolumne.DataBindings.Add("Text", this.uxBindingSource, "Kolumne", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxFilter.DataBindings.Clear();
			this.uxFilter.DataBindings.Add("Text", this.uxBindingSource, "Filter", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxFilterAdv.DataBindings.Clear();
			this.uxFilterAdv.DataBindings.Add("Text", this.uxBindingSource, "FilterAdv", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxPoredak.DataBindings.Clear();
			this.uxPoredak.DataBindings.Add("Text", this.uxBindingSource, "Poredak", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="ReportEditControlBase"/> class.
		/// </summary>
		public ReportEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_Report != null) _Report.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxID = new System.Windows.Forms.TextBox();
			uxIDLabel = new System.Windows.Forms.Label();
			this.uxNaziv = new System.Windows.Forms.TextBox();
			uxNazivLabel = new System.Windows.Forms.Label();
			this.uxIDParent = new System.Windows.Forms.TextBox();
			uxIDParentLabel = new System.Windows.Forms.Label();
			this.uxSelectString = new System.Windows.Forms.TextBox();
			uxSelectStringLabel = new System.Windows.Forms.Label();
			this.uxTip = new System.Windows.Forms.TextBox();
			uxTipLabel = new System.Windows.Forms.Label();
			this.uxKolumne = new System.Windows.Forms.TextBox();
			uxKolumneLabel = new System.Windows.Forms.Label();
			this.uxFilter = new System.Windows.Forms.TextBox();
			uxFilterLabel = new System.Windows.Forms.Label();
			this.uxFilterAdv = new System.Windows.Forms.TextBox();
			uxFilterAdvLabel = new System.Windows.Forms.Label();
			this.uxPoredak = new System.Windows.Forms.TextBox();
			uxPoredakLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIDLabel
			//
			this.uxIDLabel.Text = "ID:";
			this.uxIDLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIDLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDLabel);			
			//
			// uxID
			//
			this.uxID.ReadOnly = true;
			//this.uxTableLayoutPanel.Controls.Add(this.uxID);
			this.uxID.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxID);
			//
			// uxNazivLabel
			//
			this.uxNazivLabel.Text = "Naziv:";
			this.uxNazivLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxNazivLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxNazivLabel);			
			//
			// uxNaziv
			//
			this.uxNaziv.Width = 250;
			this.uxNaziv.MaxLength = 200;
			//this.uxTableLayoutPanel.Controls.Add(this.uxNaziv);
			this.uxNaziv.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxNaziv);
			//
			// uxIDParentLabel
			//
			this.uxIDParentLabel.Text = "IDParent:";
			this.uxIDParentLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxIDParentLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDParentLabel);			
			//
			// uxIDParent
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDParent);
			this.uxIDParent.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxIDParent);
			//
			// uxSelectStringLabel
			//
			this.uxSelectStringLabel.Text = "SelectString:";
			this.uxSelectStringLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxSelectStringLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxSelectStringLabel);			
			//
			// uxSelectString
			//
			this.uxSelectString.Width = 250;
			this.uxSelectString.Multiline = true;
			//this.uxSelectString.Height = 80;
			//this.uxTableLayoutPanel.Controls.Add(this.uxSelectString);
			this.uxSelectString.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxSelectString);
			//
			// uxTipLabel
			//
			this.uxTipLabel.Text = "Tip:";
			this.uxTipLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxTipLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxTipLabel);			
			//
			// uxTip
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxTip);
			this.uxTip.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxTip);
			//
			// uxKolumneLabel
			//
			this.uxKolumneLabel.Text = "Kolumne:";
			this.uxKolumneLabel.Location = new System.Drawing.Point(3, 130);
			this.Controls.Add(this.uxKolumneLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxKolumneLabel);			
			//
			// uxKolumne
			//
			this.uxKolumne.Width = 250;
			this.uxKolumne.MaxLength = 300;
			//this.uxTableLayoutPanel.Controls.Add(this.uxKolumne);
			this.uxKolumne.Location = new System.Drawing.Point(160, 130);
			this.Controls.Add(this.uxKolumne);
			//
			// uxFilterLabel
			//
			this.uxFilterLabel.Text = "Filter:";
			this.uxFilterLabel.Location = new System.Drawing.Point(3, 156);
			this.Controls.Add(this.uxFilterLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxFilterLabel);			
			//
			// uxFilter
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxFilter);
			this.uxFilter.Location = new System.Drawing.Point(160, 156);
			this.Controls.Add(this.uxFilter);
			//
			// uxFilterAdvLabel
			//
			this.uxFilterAdvLabel.Text = "FilterAdv:";
			this.uxFilterAdvLabel.Location = new System.Drawing.Point(3, 182);
			this.Controls.Add(this.uxFilterAdvLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxFilterAdvLabel);			
			//
			// uxFilterAdv
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxFilterAdv);
			this.uxFilterAdv.Location = new System.Drawing.Point(160, 182);
			this.Controls.Add(this.uxFilterAdv);
			//
			// uxPoredakLabel
			//
			this.uxPoredakLabel.Text = "Poredak:";
			this.uxPoredakLabel.Location = new System.Drawing.Point(3, 208);
			this.Controls.Add(this.uxPoredakLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxPoredakLabel);			
			//
			// uxPoredak
			//
			this.uxPoredak.Width = 250;
			this.uxPoredak.MaxLength = 50;
			//this.uxTableLayoutPanel.Controls.Add(this.uxPoredak);
			this.uxPoredak.Location = new System.Drawing.Point(160, 208);
			this.Controls.Add(this.uxPoredak);
			// 
			// ReportEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "ReportEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
